import { ItemRenderer } from "./ItemRenderer";
import { ItemData } from "../../resource/info/ItemData";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
//class SellItemRenderer
    
    export  class SellItemRenderer extends ItemRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            this._itemData = arg1 as ItemData;
            if (arg1) 
            {
                _code = this._itemData.itemCode;
                _item.itemData = this._itemData;
            }
            else 
            {
                _item.itemData = null;
            }
            return;
        }

        protected /* override */ onItemClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._itemData) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.MarketSellGoodsItemSelect, this._itemData));
            }
            return;
        }

        /* internal */ /* var */_itemData: ItemData;
    }
